Skip to main content

Re-embed All Knowledges

Used to re-process and re-embed all knowledge base entries. This is useful when updating embedding models, refreshing the knowledge base index, or applying new configurations to existing content.

API Endpoint

PropertyValue
Request MethodPOST
Request URLhttps://api.seliseblocks.com/kb/reembed

Request

Request Example

curl -X POST 'https://api.seliseblocks.com/kb/reembed' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"project_key": "YOUR_PROJECT_KEY",
"agent_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"kbs": [
{
"kb_id": "kb_001",
"type": "file",
"source": "document.pdf"
},
{
"kb_id": "kb_002",
"type": "text",
"source": "raw_text_content"
}
]
}'

Request Headers

FieldTypeRequiredDescription
acceptstringYesAccepted response format. Use application/json
Content-Typeapplication/jsonYesData type, must be application/json.

Request Body

Request Body Schema

{
"project_key": "string",
"agent_id": "string",
"kbs": [
{
"additionalProp1": {}
}
]
}

Request Body Parameters

FieldTypeRequiredDescription
project_keystringYesThe project key for your project.
agent_idstringYesUUID of the AI agent whose knowledge base will be re-embedded.
kbsarrayYesArray of knowledge base entry objects to re-embed.

Knowledge Base Entry Object

Each entry in the kbs array is an object containing information about a specific knowledge base item. The structure may vary depending on the knowledge type:

FieldTypeDescription
kb_idstringUnique identifier of the knowledge base entry.
typestringType of knowledge (e.g., file, text, qa, link).
sourcestringSource identifier or content reference.
note

When to Re-embed

  • After changing the embedding model in RAG configuration
  • When updating to a newer version of an embedding model
  • To refresh the vector index with improved embeddings
  • After making significant changes to chunking strategies
warning

Re-embedding can be a resource-intensive operation, especially for large knowledge bases. The process may take considerable time depending on:

  • The number of knowledge base entries
  • The size of the content
  • The complexity of the embedding model
  • Current system load

Response

Success Response (200 OK)

Returns an object containing the re-embedding status.

{
"is_success": true,
"detail": "Knowledge base entries re-embedded successfully. Processed 150 entries.",
"error": {}
}

Response Fields

FieldTypeDescription
is_successbooleanIndicates whether the re-embedding was successful.
detailstringSuccess or failure message with additional context.
errorobjectError details if the operation failed (empty if successful).

Error Response (422 Unprocessable Entity)

Returns validation error details when the request body is invalid.

{
"detail": [
{
"loc": [
"body",
"kbs"
],
"msg": "field required",
"type": "value_error.missing"
}
]
}

Error Response Fields

FieldTypeDescription
detailarrayArray of validation error objects.
locarrayLocation of the error in the request (e.g., body field).
msgstringHuman-readable error message.
typestringError type identifier.

Error Codes

Status CodeDescriptionResponse Type
200Successful ResponseSuccess
400Bad Request - Invalid knowledge base dataBad Request
422Validation Error - Invalid request parametersUnprocessable Entity
500Internal Server Error - Re-embedding failedServer Error